package com.smart.model.convert;

import com.smart.model.dtomapper.OperateRoleDtoMapper;
import com.smart.model.domain.OperateRoleDO;
import com.smart.model.vo.OperateRoleVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class OperateRoleConvert {

    public static List<OperateRoleVO> buildOperateRoleVoList(List<OperateRoleDO> operateRoleDOList) {
        if (CollectionUtils.isEmpty(operateRoleDOList)) {
            return Lists.newArrayList();
        }
        List<OperateRoleVO> operateRoleVOList = new ArrayList<>();
        for (OperateRoleDO operateRoleDO : operateRoleDOList) {
            operateRoleVOList.add(OperateRoleDtoMapper.INSTANCE.do2VO(operateRoleDO));
        }

        return operateRoleVOList;
    }
}
